/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.atp.agencia.controle;

import br.com.atp.agencia.modelo.Aluguel;
import br.com.atp.agencia.modelo.Locatario;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Afonso
 */
public class Pousada {

    private List<Aluguel> alugueis;

    public Pousada() {
        alugueis = new ArrayList();
    }

    public Aluguel getAluguel(int num) {
       return alugueis.get(num);
    }
    public int getPosicao(Aluguel a1) {
       return alugueis.lastIndexOf(a1);
    }

    public List<Aluguel> getAlugueis() {
        return alugueis;
    }

    public void setAlugueis(List<Aluguel> alugueis) {
        this.alugueis = alugueis;
    }

    public void addLocatario(int numero, Locatario l1) throws Exception {
        alugueis.get(numero).setLocatario(l1);
    }

    public void removeLocatario(int numero) throws Exception {
        alugueis.get(numero).removeLocatario();
    }

    public void removeLocatario(Locatario l1) throws Exception {
        alugueis.get(alugueis.lastIndexOf(l1)).removeLocatario();
    }

    public Double getValorDiaria(int numero) {
        return alugueis.get(numero).getTotalDevido();
    }
}
